﻿using System.Data.Entity;
using AP.Framework.Infrastructure.Entities;
using System.Data.Entity.ModelConfiguration.Conventions;

namespace AP.Framework.Infrastructure.Database
{
    public class ApContext : DbContext
    {
        public ApContext() : base("ApData") { new DropCreateDatabaseIfModelChanges<ApContext>(); }
        public DbSet<cms_Article> Article { get; set; }
        public DbSet<cms_ArticleCategory> ArticleCategory { get; set; }
        public DbSet<cms_Channel> Channel { get; set; }
        public DbSet<cms_Download> Download { get; set; }
        public DbSet<cms_DownloadAttach> DownloadAttach { get; set; }
        public DbSet<cms_FeedBack> FeedBack { get; set; }
        public DbSet<cms_Job> Job { get; set; }
        public DbSet<cms_JobCategory> JobCategory { get; set; }
        public DbSet<cms_Link> Link { get; set; }
        public DbSet<cms_Photo> Photo { get; set; }
        public DbSet<cms_PhotoCategory> PhotoCategory { get; set; }
        public DbSet<cms_Product> Product { get; set; }
        public DbSet<cms_ProductCategory> ProductCategory { get; set; }
        public DbSet<sys_Modules> Modules { get; set; }
        public DbSet<sys_Param> Param { get; set; }
        public DbSet<sys_RoleModules> RoleModules { get; set; }
        public DbSet<sys_Roles> Roles { get; set; }
        public DbSet<sys_UserRoles> UserRoles { get; set; }
        public DbSet<sys_Users> Users { get; set; }
        public DbSet<cms_CompanyProfile> CompanyProfile { get; set; }
        public DbSet<cms_Contact> Contact { get; set; }
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();

        }
    }
}